package com.halflife.framework.participant.user;

import com.halflife.framework.domain.BaseDomain;
import com.halflife.framework.generator.annotation.Join;
import com.halflife.framework.generator.annotation.QueryAnn;
import com.halflife.framework.generator.build.SimpleBuilder;
import com.halflife.framework.generator.build.UpdataBuilder;
import com.halflife.framework.participant.Department;
import com.halflife.framework.participant.Team;
import org.junit.jupiter.api.Test;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@QueryAnn(mainTitle = " 用户管理",title = "用户管理",table = "t_userview")
public class UserView extends BaseDomain{
    @Test
    public void generate()throws Exception{
        SimpleBuilder builder = new UpdataBuilder();
        builder.buildMapper(this.getClass());
//        builder.buildAlterTable(this.getClass());
    }
    @QueryAnn(value = "name", refered = true,operate = "like")
    private String name;
    @QueryAnn(value = "User name", refered = true,operate = "like")
    private String userName;
    @QueryAnn(value = "Profile photo")
    private String profilePhoto;
    @QueryAnn(value = "Email",operate = "like")
    private String email;
    @QueryAnn(value = "密码", refered = true)
    private String password;
    @QueryAnn(value = "备注",operate = "like")
    private String memo;
    //0-教师 1-学生 2-教职工 3-管理员
    @QueryAnn(value = "类型", refered = true)
    private String type;

    @QueryAnn(value = "loginCount")
    private Integer loginCount;
    @QueryAnn(value = "lastLoginTime")
    @DateTimeFormat(pattern = "MM/dd/yyyy HH:mm:ss")
    private Date lastLoginTime;
    @QueryAnn(value = "modifyTime")
    @DateTimeFormat(pattern = "MM/dd/yyyy HH:mm:ss")
    private Date modifyTime;
    //验证信息
    private String validMessage;
    @QueryAnn(value = "部门Id")
    private Integer departmentId;
    @QueryAnn(value = "部门")
    @Join(joinType = "I")
    private Department department;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getValidMessage() {
        return validMessage;
    }

    public void setValidMessage(String validMessage) {
        this.validMessage = validMessage;
    }

    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public String getProfilePhoto() {
        return profilePhoto;
    }

    public void setProfilePhoto(String profilePhoto) {
        this.profilePhoto = profilePhoto;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getLoginCount() {
        return loginCount;
    }

    public void setLoginCount(Integer loginCount) {
        this.loginCount = loginCount;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
}
